package com.chat.service;

import com.chat.Local;
import com.chat.common.Group;
import com.chat.common.Message;
import com.chat.common.MessageType;
import com.chat.view.GroupVerifyView;
import javafx.application.Platform;

import static com.chat.view.GroupVerifyController.groupver;
/*
 拒绝群聊验证
 */
public class RefuseGroupVerify {
      public void refusegroupverify(String groupid,String userid){
            Message msg=new Message();
            msg.setMesType(MessageType.MESSAGE_REFUSE_GROUP_VERIFY);
            Group group=new Group();
            group.setId(groupid);
            group.setAddid(userid);
            msg.setData(group);
            ClientConnectServerThread clientConnectServerThread=ManageClientConnectServerThread.getClientConnectServerThread(Local.user.getUsername());
            clientConnectServerThread.send(msg);
            Platform.runLater(new Runnable() {
                  @Override
                  public void run() {
                        ((javafx.scene.control.ListView) GroupVerifyView.$("verify")).getItems().clear();
                  }
            });
            groupver.clear();
            GetGroupVerify ggv=new GetGroupVerify();
            ggv.getgroupverify();
      }
}
